package com.dadi.broadcastdemo1;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.widget.Toast;

public class MyReceiver extends BroadcastReceiver {

    @Override
    public void onReceive(Context context, Intent intent) {
        Toast.makeText(context, "Receive an intent", Toast.LENGTH_SHORT).show();
        if(intent.getAction().equals(MainActivity.STATIC_ACTION)){
            Toast.makeText(context, "We received an intent for STATIC", Toast.LENGTH_SHORT).show();
        } else if(intent.getAction().equals(MainActivity.DYNAMIC_ACTION)){
            Toast.makeText(context, "We received an intent for DYNAMIC", Toast.LENGTH_SHORT).show();
        }
    }
}
